function reichardt_sim_result = independent_reichardt_sim(prev_img, curr_img, pars)
%% reichardt
[r c]=size(curr_img);

dr=pars.dr;
dc=pars.dc;
    rmin = max(1, 1 - dr);
    cmin = max(1, 1 - dc);
    rmax = min(r, r - dr);
    cmax = min(c, c - dc);
    q = quantizer('fixed', [24,20]); 
    
    if(rmin==1)
		rmax_s = r ; 
		rmin_s = r-rmax +1 ;
    end
			
    if(rmin~=1) 

	rmax_s = r-rmin +1;
	rmin_s = 1;
    end

    if(cmin==1)
		cmax_s = c ; 
		cmin_s = c-cmax +1 ;
    end
			
    if(cmin~=1) 

	cmax_s = c-cmin +1;
	cmin_s = 1;
    end
 
   
     
     
    
    
    scurr = curr_img(rmin_s:rmax_s, cmin_s:cmax_s);
    sprev = prev_img(rmin_s:rmax_s, cmin_s:cmax_s);
    curr = curr_img(rmin:rmax, cmin:cmax);
    prev = prev_img(rmin:rmax, cmin:cmax);
   
    result = zeros(r,c);
    result(rmin:rmax, cmin:cmax) = abs(curr.*sprev - prev.* scurr);
    reichardt_sim_result = result;
   
      
      
      
